package com.lars.nacosserver.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import static org.springframework.web.bind.annotation.RequestMethod.GET;

/**
 * @Authror zhoay
 * @Date 2022/1/9 18:01
 */
@Controller
public class ConfigController {


    @NacosValue(value = "${useLocalCache:false}", autoRefreshed = true)
    private String useLocalCache;

    @NacosValue(value="${lars:bendi}",autoRefreshed = true)
    private String lars;


    @RequestMapping(value = "/get", method = GET)
    @ResponseBody
    public String get() {
        return lars+useLocalCache;
    }

}
